package langsi.ssm.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import langsi.ssm.exception.TestException;
import langsi.ssm.mapper.TestMapper;
import langsi.ssm.po.TestCustom;
import langsi.ssm.po.TestVo;

/**
 * 测试服务类
 * 
 * @author SevenKey
 * 
 *
 */
@Service
@Transactional
public class TestService {
	@Resource
	private TestMapper testMapper;

	/**
	 * updateMoneyById 通过id增加金额--测试事务
	 * 
	 * @param money
	 *            增加的金额
	 * @param testCustom
	 *            test扩展类里封装修改的id
	 * @throws TestException
	 */
	public void updateMoneyById(Double money, TestCustom testCustom) throws Exception {
		TestVo testVo = new TestVo();
		testVo.setChangemoney(money);
		testVo.setTestCustom(testCustom);
		testMapper.updateMoneyById(testVo);
		// 测试事务
		int a = 10 / 0;
	}

}
